package com.mou.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mou.dto.CartDTO;
import com.mou.entity.Cart;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface    CartMapper extends BaseMapper<Cart> {
    @Select("select count(*) from cart where user_id = #{userId} and product_id = #{productId} and deleted=0")
    Integer uniqueUserProduct(CartDTO cartDTO);

    @Select("select * from cart where user_id = #{id} and deleted = 0")
    List<Cart> getCartById(Integer id);
}
